<?php
namespace app\manage\model;

use think\Model;
//  基础模型
class BaseModel extends Model
{
    protected $autoWriteTimestamp = true;
    protected $dateFormat = 'Y-m-d';
    protected $statusText = [0 => '禁用', 1 => '正常'];
    protected $append = ['status_text'];
    // 增加statusText字段的读取器 
    public function getStatusTextAttr($value, $data)
    {
    	return $this->statusText[$data['status']];
    }
}
